home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / cfir2d.z / cfir2d
Encoding:
Text File  |  2002-10-03  |  32.2 KB  |  595 lines

  1.  
  2.  
  3.  
  4. CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CCCCFFFFIIIIRRRR2222DDDD, ZZZZFFFFIIIIRRRR2222DDDD, SSSSFFFFIIIIRRRR2222DDDD, DDDDFFFFIIIIRRRR2222DDDD - Compute the two-dimensional (2D)
  10.      convolution of two 2D arrays
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      Single precision complex
  14.  
  15.           Fortran:
  16.                CCCCAAAALLLLLLLL CCCCFFFFIIIIRRRR2222DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_1_x_0,,,, _n_x_1,,,, _i_2_x_0,,,, _n_x_2,,,, _h,,,, _i_n_c_h,,,, _l_d_h,,,,
  17.                _i_1_h_0,,,, _n_h_1,,,, _i_2_h_0,,,, _n_h_2,,,, _y,,,, _i_n_c_y,,,, _l_d_y,,,, _i_1_y_0,,,, _n_y_1,,,, _i_2_y_0,,,, _n_y_2,,,,
  18.                _a_l_p_h_a,,,, _b_e_t_a))))
  19.  
  20.           C/C++:
  21.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  22.                vvvvooooiiiidddd ccccffffiiiirrrr2222dddd(((( ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _l_d_x,,,, iiiinnnntttt _i_1_x_0,,,, iiiinnnntttt
  23.                _n_x_1,,,, iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _l_d_h,,,, iiiinnnntttt
  24.                _i_1_h_0,,,, iiiinnnntttt _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx _y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt
  25.                _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,, iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, iiiinnnntttt _n_y_2,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_a_l_p_h_a,,,,
  26.                ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_b_e_t_a))));;;;
  27.  
  28.           C++ STL:
  29.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  30.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  31.                vvvvooooiiiidddd ccccffffiiiirrrr2222dddd(((( ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _1_d_x,,,, iiiinnnntttt _i_1_x_0,,,,
  32.                iiiinnnntttt _n_x_1,,,, iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt
  33.                _l_d_h,,,, iiiinnnntttt _i_1_h_0,,,, iiiinnnntttt _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> _y,,,,
  34.                iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,, iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  35.                *_a_l_p_h_a,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_b_e_t_a))));;;;
  36.  
  37.      Double precision complex
  38.  
  39.           Fortran:
  40.                CCCCAAAALLLLLLLL ZZZZFFFFIIIIRRRR2222DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_1_x_0,,,, _n_x_1,,,, _i_2_x_0,,,, _n_x_2,,,, _h,,,, _i_n_c_h,,,, _l_d_h,,,,
  41.                _i_1_h_0,,,, _n_h_1,,,, _i_2_h_0,,,, _n_h_2,,,, _y,,,, _i_n_c_y,,,, _l_d_y,,,, _i_1_y_0,,,, _n_y_1,,,, _i_2_y_0,,,, _n_y_2,,,,
  42.                _a_l_p_h_a,,,, _b_e_t_a))))
  43.  
  44.           C/C++:
  45.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  46.                vvvvooooiiiidddd ccccffffiiiirrrr2222dddd(((( ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _l_d_x,,,, iiiinnnntttt _i_1_x_0,,,, iiiinnnntttt
  47.                _n_x_1,,,, iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _l_d_h,,,, iiiinnnntttt
  48.                _i_1_h_0,,,, iiiinnnntttt _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx _y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt
  49.                _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,, iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_a_l_p_h_a,,,,
  50.                ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_b_e_t_a))));;;;
  51.  
  52.           C++ STL:
  53.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  54.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  55.                vvvvooooiiiidddd ccccffffiiiirrrr2222dddd(((( ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _l_d_x,,,, iiiinnnntttt _i_1_x_0,,,,
  56.                iiiinnnntttt _n_x_1,,,, iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt
  57.                _l_d_h,,,, iiiinnnntttt _i_1_h_0,,,, iiiinnnntttt _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> _y,,,,
  58.                iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,, iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  59.                *_a_l_p_h_a,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_b_e_t_a))));;;;
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      Single precision
  75.  
  76.           Fortran:
  77.                CCCCAAAALLLLLLLL SSSSFFFFIIIIRRRR2222DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_1_x_0,,,, _n_x_1,,,, _i_2_x_0,,,, _n_x_2,,,, _h,,,, _i_n_c_h,,,, _l_d_h,,,,
  78.                _i_1_h_0,,,, _n_h_1,,,, _i_2_h_0,,,, _n_h_2,,,, _y,,,, _i_n_c_y,,,, _l_d_y,,,, _i_1_y_0,,,, _n_y_1,,,, _i_2_y_0,,,, _n_y_2,,,,
  79.                _a_l_p_h_a,,,, _b_e_t_a))))
  80.  
  81.           C/C++:
  82.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  83.                vvvvooooiiiidddd ssssffffiiiirrrr2222dddd(((( ffffllllooooaaaatttt *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _l_d_x,,,, iiiinnnntttt _i_1_x_0,,,, iiiinnnntttt _n_x_1,,,,
  84.                iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ffffllllooooaaaatttt _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _l_d_h,,,, iiiinnnntttt _i_1_h_0,,,, iiiinnnntttt
  85.                _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ffffllllooooaaaatttt _y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,,
  86.                iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, ffffllllooooaaaatttt _a_l_p_h_a,,,, ffffllllooooaaaatttt _b_e_t_a))));;;;
  87.  
  88.      Double precision
  89.  
  90.           Fortran:
  91.                CCCCAAAALLLLLLLL DDDDFFFFIIIIRRRR2222DDDD ((((_x,,,, _i_n_c_x,,,, _l_d_x,,,, _i_1_x_0,,,, _n_x_1,,,, _i_2_x_0,,,, _n_x_2,,,, _h,,,, _i_n_c_h,,,, _l_d_h,,,,
  92.                _i_1_h_0,,,, _n_h_1,,,, _i_2_h_0,,,, _n_h_2,,,, _y,,,, _i_n_c_y,,,, _l_d_y,,,, _i_1_y_0,,,, _n_y_1,,,, _i_2_y_0,,,, _n_y_2,,,,
  93.                _a_l_p_h_a,,,, _b_e_t_a))))
  94.  
  95.           C/C++:
  96.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  97.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  98.                vvvvooooiiiidddd ddddffffiiiirrrr2222dddd(((( ddddoooouuuubbbblllleeee *_x,,,, iiiinnnntttt _i_n_c_x,,,, iiiinnnntttt _l_d_x,,,, iiiinnnntttt _i_1_x_0,,,, iiiinnnntttt _n_x_1,,,,
  99.                iiiinnnntttt _i_2_x_0,,,, iiiinnnntttt _n_x_2,,,, ddddoooouuuubbbblllleeee _h,,,, iiiinnnntttt _i_n_c_h,,,, iiiinnnntttt _l_d_h,,,, iiiinnnntttt _i_1_h_0,,,, iiiinnnntttt
  100.                _n_h_1,,,, iiiinnnntttt _i_2_h_0,,,, iiiinnnntttt _n_h_2,,,, ddddoooouuuubbbblllleeee _y,,,, iiiinnnntttt _i_n_c_y,,,, iiiinnnntttt _l_d_y,,,, iiiinnnntttt _i_1_y_0,,,,
  101.                iiiinnnntttt _n_y_1,,,, iiiinnnntttt _i_2_y_0,,,, ddddoooouuuubbbblllleeee _a_l_p_h_a,,,, ddddoooouuuubbbblllleeee _b_e_t_a))));;;;
  102.  
  103. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  104.      These routines are part of the SCSL Scientific Library and can be loaded
  105.      using either the ----llllssssccccssss or the ----llllssssccccssss____mmmmpppp option.  The ----llllssssccccssss____mmmmpppp option
  106.      directs the linker to use the multi-processor version of the library.
  107.  
  108.      When linking to SCSL with ----llllssssccccssss or ----llllssssccccssss____mmmmpppp, the default integer size is
  109.      4 bytes (32 bits). Another version of SCSL is available in which integers
  110.      are 8 bytes (64 bits).  This version allows the user access to larger
  111.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  112.      by using the ----llllssssccccssss____iiii8888 option or the ----llllssssccccssss____iiii8888____mmmmpppp option. A program may use
  113.      only one of the two versions; 4-byte integer and 8-byte integer library
  114.      calls cannot be mixed.
  115.  
  116.      The C and C++ prototypes shown above are appropriate for the 4-byte
  117.      integer version of SCSL. When using the 8-byte integer version, the
  118.      variables of type iiiinnnntttt become lllloooonnnngggg lllloooonnnngggg and the <<<<ssssccccssssllll____fffffffftttt____iiii8888....hhhh>>>> header
  119.      file should be included.
  120.  
  121. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  122.      These routines compute the convolution of a 2D filter array _h with the 2D
  123.      array _x, producing the output 2D array _y:
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))
  137.  
  138.  
  139.  
  140.           _y = beta * _y + alpha * _h * _x
  141.  
  142.      Let the following be the filter and data matrices:
  143.  
  144.           _H = _h_i, _j 0 <=_i <=_n_h_1,  1<= _j <=_n_h_2
  145.  
  146.           _X = _x_i, _j  0<= _i <=_n_x_1, 1 <=_j < _n_x_2
  147.  
  148.      The convolution operation is defined as:
  149.  
  150.  
  151.  
  152.                Y(i,j) = Sum  Sum  H(k,l) * x(i+k, j+l)
  153.                          k    l
  154.  
  155.  
  156.      The matrix _Y has values defined for 0<= _i<(nx1+nh1-1) and 0 <= j < (nx2 +
  157.      nh2 - 1). In the ****FFFFIIIIRRRR2222DDDD routines, the number of terms in the output array
  158.      is specified by the arguments _n_y_1 and _n_y_2.  If _n_y_1 < (_n_x_1 + _n_h_1 - 1) or
  159.      _n_y_2 < (_n_x_2 + _n_h_2 - 1), the output array y is truncated.  If _n_y_1 < (_n_x_1 +
  160.      _n_h_1 - 1) or _n_y_2 < (_n_x_2 + _n_h_2 - 1), the terms beyond _i = (_n_x_1 + _n_h_1 - 2)
  161.      and _j = (_n_x_2 + _n_h_2 - 2) are set to 0.
  162.  
  163.      Generally, the arrays _x, _h and _y represent signals sampled at equal
  164.      intervals in two dimensions, and the indexes of the arrays denote the
  165.      samples. If all three signals are aligned, we may, without loss of
  166.      generality, set the initial samples to 0 in both dimensions, as in the
  167.      formulas above.
  168.  
  169.      The ****FFFFIIIIRRRR2222DDDD routines, however, permit more generality than this. The
  170.      signals may be shifted from each other using input parameters specifiying
  171.      the initial samples in each dimension. This can be useful in several
  172.      situations. For example, if the input array has leading zero values that
  173.      one does not wish to store, iiii1111xxxx0000 and iiii2222xxxx0000 may be set to the sample
  174.      corresponding to the first non-zero element in the input array, and
  175.      previous samples are treated as 0. Another use is to limit the output to
  176.      just the "fully engaged" terms of the convolution.
  177.  
  178.      When nx1 >= _n_h_1 and _n_x_2 >= _n_h_2, the convolution defined above has ramp-up
  179.      and ramp-down regions in which fewer than all _n_h_1*_n_h_2 filter values
  180.      contribute to the output value, YYYY((((iiii,,,,jjjj)))). Setting iiii1111yyyy0000 to _n_h_1-1 and iiii2222yyyy0000 to
  181.      _n_h_2-1 causes the first value output to correspond to sample (_n_h_1-1, _n_h_2-
  182.      1), thus skipping the ramp up region. Setting _n_y_1 to _n_x_1-_n_h_1+1 and _n_y_2 to
  183.      _n_x_2-_n_h_2+1 then drops the ramp-down terms, limiting the output to just the
  184.      fully engaged part.
  185.  
  186.      Note that, instead of (0,0), the initial sample could just as easily have
  187.      been labeled (1,1) or (10,1) or (0,-78); the relevant point is that the
  188.      first elements of each of the x, h and y arrays are defined to be the
  189.      same sample as long as iiii1111xxxx0000 ==== iiii1111hhhh0000 ==== iiii1111yyyy0000 and iiii2222xxxx0000 ==== iiii2222hhhh0000 ==== iiii2222yyyy0000.
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))
  203.  
  204.  
  205.  
  206.      See the NOTES section of this man page for information about the
  207.      interpretation of the data types described in the following arguments.
  208.  
  209.      These routines have the following arguments:
  210.  
  211.      _x         Array of dimension (_l_d_x, _n_x_2). (input).
  212.                CCCCFFFFIIIIRRRR2222DDDD: Single precision complex array.
  213.                ZZZZFFFFIIIIRRRR2222DDDD: Double precision complex array.
  214.                SSSSFFFFIIIIRRRRCCCC2222DDDD: Single precision array.
  215.                DDDDFFFFIIIIRRRR2222DDDD: Double precision array.
  216.                Input array containing the data to be convolved with _h.
  217.  
  218.      _i_n_c_x      Integer. (input)
  219.                Increment between two successive values of _x.  _i_n_c_x must not be
  220.                0.
  221.  
  222.      _l_d_x       Integer.  (input)
  223.                The number of rows in the _x array, as it was declared in the
  224.                calling program (the leading dimension of _x).  _l_d_x >= MAX (_n_x_1
  225.                * _i_n_c_x, 1)
  226.  
  227.      _i_1_x_0      Integer. (input)
  228.                Sample corresponding to the first element of each column of _x.
  229.  
  230.      _n_x_1       Integer. (input)
  231.                The number of elements in each column of _x.  _n_x_1 >= 0.
  232.  
  233.      _i_2_x_0      Integer. (input).
  234.                Sample corresponding to the first element of each row of _x.
  235.  
  236.      _n_x_2       Integer. (input).
  237.                Number of elements in each row of _x.  _n_x_2 >= 0.
  238.  
  239.      _h         Array of dimension (_l_d_h, _n_h_2). (input).
  240.                CCCCFFFFIIIIRRRR2222DDDD: Single precision complex array.
  241.                ZZZZFFFFIIIIRRRR2222DDDD: Double precision complex array.
  242.                SSSSFFFFIIIIRRRR2222DDDD: Single precision array.
  243.                DDDDFFFFIIIIRRRR2222DDDD: Double precision array.
  244.                Input array containing the filter matrix to be convolved with
  245.                _x.
  246.  
  247.      _i_n_c_h      Integer.  (input)
  248.                Increment between two successive values of _h. _i_n_c_h must not be
  249.                0.
  250.  
  251.      _l_d_h       Integer.  (input)
  252.                The number of rows in the _h array, as it was declared in the
  253.                calling program (the leading dimension of _h). _l_d_h >= MAX(_n_h_1 *
  254.                _i_n_c_h, 1).
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))
  269.  
  270.  
  271.  
  272.      _i_1_h_0      Integer.  (input)
  273.                Sample corresponding to the first element of each column of _h.
  274.  
  275.      _n_h_1       Integer.  (input)
  276.                The number of elements in each column of _h.  _n_h_1 >= 0.
  277.  
  278.      _i_2_h_0      Integer.  (input)
  279.                Sample corresponding to the first element of each row of _h.
  280.  
  281.      _n_h_2       Integer.  (input)
  282.                Specifies the number of elements in each row of _h.  _n_h_2 >= 0.
  283.  
  284.      _y         Array of dimension (_l_d_y, _n_y_2).  (input and output)
  285.                CCCCFFFFIIIIRRRR2222DDDD: Single precision complex array.
  286.                ZZZZFFFFIIIIRRRR2222DDDD: Double precision complex array.
  287.                SSSSFFFFIIIIRRRR2222DDDD: Single precision array.
  288.                DDDDFFFFIIIIRRRR2222DDDD: Double precision array.
  289.                Output of FIR filter. On entry the array _y must have been
  290.                initialized, except when beta is zero.  In that case, _y need
  291.                not be initialized.  On exit, the result overwrites _y.
  292.  
  293.      _i_n_c_y      Integer.  (input)
  294.                Increment between two successive values of _y.  _i_n_c_y must not be
  295.                0.
  296.  
  297.      _l_d_y       Integer.  (input)
  298.                The number of rows in the _y array, as it was declared in the
  299.                calling program (the leading dimension of _y). _l_d_y >= MAX( _n_y_1 *
  300.                _i_n_c_y, 1).
  301.  
  302.      _i_1_y_0      Integer.  (input)
  303.                Sample corresponding to the first element of each column of _y.
  304.  
  305.      _n_y_1       Integer.  (input)
  306.                Number of elements in each column of _y.  _n_y_1 >= 0.
  307.  
  308.      _i_2_y_0      Integer.  (input)
  309.                Index of the first element of each row of _y.
  310.  
  311.      _n_y_2       Integer.  (input)
  312.                Number of elements in each row of _y.  _n_y_2 >= 0.
  313.  
  314.      _a_l_p_h_a     Scale factor for the convolution.  (input).
  315.                CCCCFFFFIIIIRRRR2222DDDD: Single precision Complex.
  316.                ZZZZFFFFIIIIRRRR2222DDDD: Double precision complex.
  317.                SSSSFFFFIIIIRRRR2222DDDD: Single precision.
  318.                DDDDFFFFIIIIRRRR2222DDDD: Double precision.
  319.                For C/C++, a pointer to this value is passed.
  320.  
  321.      _b_e_t_a      Scale factor for the output _y. (input)
  322.                CCCCFFFFIIIIRRRR1111DDDD: Complex.
  323.                ZZZZFFFFIIIIRRRR1111DDDD: Double complex.
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))
  335.  
  336.  
  337.  
  338.                SSSSFFFFIIIIRRRR1111DDDD: Real.
  339.                DDDDFFFFIIIIRRRR1111DDDD: Double precision.
  340.                When _b_e_t_a is zero, _y need not be set on input.  For C/C++, a
  341.                pointer to this value is passed.
  342.  
  343. NNNNOOOOTTTTEEEESSSS
  344.      The following data types are described in this documentation:
  345.  
  346.           TTTTeeeerrrrmmmm UUUUsssseeeedddd                     DDDDaaaattttaaaa ttttyyyyppppeeee
  347.  
  348.      Fortran:
  349.  
  350.           Array dimensioned 0000........_n----1111      xxxx((((0000::::nnnn----1111))))
  351.  
  352.           Array of dimensions (_m,_n)     xxxx((((mmmm,,,,nnnn))))
  353.  
  354.           Array of dimensions (_m,_n,_p)   xxxx((((mmmm,,,,nnnn,,,,pppp))))
  355.  
  356.           IIIInnnntttteeeeggggeeeerrrr                       IIIINNNNTTTTEEEEGGGGEEEERRRR (IIIINNNNTTTTEEEEGGGGEEEERRRR****8888 for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  357.  
  358.           Single precision              RRRREEEEAAAALLLL
  359.  
  360.           Double precision              DDDDOOOOUUUUBBBBLLLLEEEE PPPPRRRREEEECCCCIIIISSSSIIIIOOOONNNN
  361.  
  362.           Single precision complex      CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  363.  
  364.           Double precision complex      DDDDOOOOUUUUBBBBLLLLEEEE CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  365.  
  366.      C/C++:
  367.  
  368.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  369.  
  370.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  371.  
  372.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  373.  
  374.           IIIInnnntttteeeeggggeeeerrrr                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  375.  
  376.           Single precision              ffffllllooooaaaatttt
  377.  
  378.           Double precision              ddddoooouuuubbbblllleeee
  379.  
  380.           Single precision complex      ssssccccssssllll____ccccoooommmmpppplllleeeexxxx
  381.  
  382.           Double precision complex      ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx
  383.  
  384.      C++ STL:
  385.  
  386.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))
  401.  
  402.  
  403.  
  404.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  405.  
  406.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  407.  
  408.           IIIInnnntttteeeeggggeeeerrrr                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  409.  
  410.           Single precision              ffffllllooooaaaatttt
  411.  
  412.           Double precision              ddddoooouuuubbbblllleeee
  413.  
  414.           Single precision complex      ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  415.  
  416.           Double precision complex      ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  417.  
  418. CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS
  419.      The arrays _x, _h and _y must be non-overlapping.
  420.  
  421. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  422.      The following example computes the convolution of a 4x4-sample array _x
  423.      with a filter _h containing 3x3 samples:
  424.  
  425.      Fortran:
  426.  
  427.            REAL X(0:3,0:3), H(0:2,0:2), Y(0:5,0:5)
  428.            REAL ALPHA, BETA
  429.            ALPHA = 1.0
  430.            BETA  = 0.0
  431.  
  432.            DO J = 0, 3
  433.               DO I = 0, 3
  434.                   X(I,J) = -1.0
  435.               ENDDO
  436.            ENDDO
  437.            X(0,0) = 1.0
  438.  
  439.            DO J = 0, 2
  440.               DO I = 0, 2
  441.                  H(i,j) = 1.0/(i+j+1)
  442.               ENDDO
  443.            ENDDO
  444.            CALL SFIR2D(X(0,0), 1, 4, 0, 4, 0, 4,
  445.           &            H(0,0), 1, 3, 0, 3, 0, 3,
  446.           &            Y(0,0), 1, 6, 0, 6, 0, 6, ALPHA, BETA)
  447.  
  448.  
  449.      C/C++:
  450.  
  451.           #include <scsl_fft.h>
  452.           float x[4][4], h[3][3], y[6][6];
  453.           float alpha = 1.0f;
  454.           float beta  = 0.0f;
  455.           int i, j;
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))
  467.  
  468.  
  469.  
  470.           for (j=0; j<4; j++) {
  471.              for (i=0; i<4; i++) {
  472.                 x[j][i] = -1.0f;
  473.              }
  474.           }
  475.           x[0][0] = 1.0f;
  476.           for (j=0; j<3; j++) {
  477.              for (i=0; i<3; i++) {
  478.                 h[i] = 1.0f/(i+j+1);
  479.              }
  480.           }
  481.           sfir2d((float *) x, 1, 4, 0, 4, 0, 4,
  482.                  (float *) h, 1, 3, 0, 3, 0, 3,
  483.                  (float *) y, 1, 6, 0, 6, 0, 6, alpha, beta);
  484.  
  485.  
  486.      The output is
  487.  
  488.                       Y(*,0)   Y(*,1)   Y(*,2)   Y(*,3)   Y(*,4)   Y(*,5)
  489.  
  490.           Y(0,*)      1.0000  -0.5000  -1.1667  -1.8333  -0.8333  -0.3333
  491.           Y(1,*)     -0.5000  -1.6667  -2.4167  -2.9167  -1.4167  -0.5833
  492.           Y(2,*)     -1.1667  -2.4167  -3.3000  -3.7000  -1.8667  -0.7833
  493.           Y(3,*)     -1.8333  -2.9167  -3.7000  -3.7000  -1.8667  -0.7833
  494.           Y(4,*)     -0.8333  -1.4167  -1.8667  -1.8667  -1.0333  -0.4500
  495.           Y(5,*)     -0.3333  -0.5833  -0.7833  -0.7833  -0.4500  -0.2000
  496.  
  497.  
  498.      Changing i1x0 to 1 produces the following shift in the output:
  499.  
  500.  
  501.                       Y(*,0)   Y(*,1)   Y(*,2)   Y(*,3)   Y(*,4)   Y(*,5)
  502.  
  503.           Y(0,*)      0.0000   0.0000   0.0000   0.0000   0.0000   0.0000
  504.           Y(1,*)      1.0000  -0.5000  -1.1667  -1.8333  -0.8333  -0.3333
  505.           Y(2,*)     -0.5000  -1.6667  -2.4167  -2.9167  -1.4167  -0.5833
  506.           Y(3,*)     -1.1667  -2.4167  -3.3000  -3.7000  -1.8667  -0.7833
  507.           Y(4,*)     -1.8333  -2.9167  -3.7000  -3.7000  -1.8667  -0.7833
  508.           Y(5,*)     -0.8333  -1.4167  -1.8667  -1.8667  -1.0333  -0.4500
  509.  
  510.  
  511.      Changing i2h0 to -1 produces the following shift in the output:
  512.  
  513.                       Y(*,0)   Y(*,1)   Y(*,2)   Y(*,3)   Y(*,4)   Y(*,5)
  514.           Y(0,*)     -0.5000  -1.1667  -1.8333  -0.8333  -0.3333   0.0000
  515.           Y(1,*)     -1.6667  -2.4167  -2.9167  -1.4167  -0.5833   0.0000
  516.           Y(2,*)     -2.4167  -3.3000  -3.7000  -1.8667  -0.7833   0.0000
  517.           Y(3,*)     -2.9167  -3.7000  -3.7000  -1.8667  -0.7833   0.0000
  518.           Y(4,*)     -1.4167  -1.8667  -1.8667  -1.0333  -0.4500   0.0000
  519.           Y(5,*)     -0.5833  -0.7833  -0.7833  -0.4500  -0.2000   0.0000
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))                                                          CCCCFFFFIIIIRRRR2222DDDD((((3333SSSS))))
  533.  
  534.  
  535.  
  536.      Changing i1y0 to +1 and i2y0 to -1 produces the following shift in the
  537.      output:
  538.  
  539.  
  540.                       Y(*,0)   Y(*,1)   Y(*,2)   Y(*,3)   Y(*,4)   Y(*,5)
  541.           Y(0,*)      0.0000  -0.5000  -1.6667  -2.4167  -2.9167  -1.4167
  542.           Y(1,*)      0.0000  -1.1667  -2.4167  -3.3000  -3.7000  -1.8667
  543.           Y(2,*)      0.0000  -1.8333  -2.9167  -3.7000  -3.7000  -1.8667
  544.           Y(3,*)      0.0000  -0.8333  -1.4167  -1.8667  -1.8667  -1.0333
  545.           Y(4,*)      0.0000  -0.3333  -0.5833  -0.7833  -0.7833  -0.4500
  546.           Y(5,*)      0.0000   0.0000   0.0000   0.0000   0.0000   0.0000
  547.  
  548.  
  549. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  550.      CCCCFFFFIIIIRRRR1111DDDD(3S), CCCCFFFFIIIIRRRRMMMM1111DDDD(3S), IIIINNNNTTTTRRRROOOO____FFFFFFFFTTTT(3S), IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S)
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.                                                                         PPPPaaaaggggeeee 9999
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.